/**
 * 窗口相关函数
 * @author SPY
 * @url 语雀:https://www.yuque.com/study365
 */

// 获取窗口可视范围的高度
const getClientHeight = () => {
  let height = 0;
  const { clientHeight: bodyHeight } = document.body; // BODY对象高度
  const { clientHeight } = document.documentElement; // 可见区域宽度
  if (bodyHeight && clientHeight) {
    height = bodyHeight < clientHeight ? bodyHeight : clientHeight;
  } else {
    height = bodyHeight > clientHeight ? clientHeight : bodyHeight;
  }
  return height;
};

export default {
  getClientHeight,
};
